package cn.kgc.mushroomdatabaseprovider.typecontroller;

import cn.kgc.mushroomcommon.pojo.Type;
import cn.kgc.mushroomdatabaseprovider.service.TypeService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/type")
public class TypeController {

    @Resource
    TypeService typeService;

    @RequestMapping("/selectType")
    public List<Type> selectType(){
         List<Type> types = typeService.selectType();
         return types;
    }

    @RequestMapping("/selectshoptype")
    public List<Type> selectshoptype(@RequestParam("sid")Integer sid){
         List<Type> selectshoptype = typeService.selectshoptype(sid);
         return selectshoptype;
    }

}
